
// document.getElementById('#myNavbar').innerHTML = '<object type="text/html" data="../myNavbar.html" ></object>';
$('#myNavbar').append("<nav class='navbar navbar-default navbar-expand-sm bg-light'>" +
    "<div class='container-fluid'>" +
    "        <div class='navbar-header'><a class='navbar-brand' href='index.html'>BestClass</a></div>" +
    "        <div class='navbar-collapse collapse'>" +
    "            <ul class='nav navbar-nav'>" +
    "                <li><a href='index.html'>课堂</a></li>" +
    "                <li><a href='#'>私信</a></li>" +
    "                <li><a href='#'>文库</a></li>" +
    "            </ul>" +
    "            <ul class='nav navbar-nav navbar-right'>" +
    "                <li class='dropdown'>" +
    "                    <a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-haspopup='true' aria-expanded='false'> <span id='name'></span> <span class='caret'></span></a>" +
    "                    <ul class='dropdown-menu'>" +
    "                        <li>" +
    "                            <a href='./personal.html'>个人中心</a>" +
    "                            <a href='./login.html' id='signOut' onclick='signOut(this)'>注销</a>" +
    "                        </li>" +
    "                    </ul>" +
    "" +
    "                </li>" +
    "            </ul>" +
    "        </div>" +
    "    </div>" +
    "</nav>");

var character = sessionStorage.getItem('character');
if (character == 'student'){
    document.getElementById("name").innerText = name + "同学";
}
else if (character == 'teacher'){
    document.getElementById("name").innerText = name + "老师";
}

function signOut(btn) {
    sessionStorage.setItem('verify','false');
    location.href="login.html";
}